home *** CD-ROM | disk | FTP | other *** search
/ Cream of the Crop 25 / Cream of the Crop 25.iso / bbs / ny_100.zip / STRUCT.DOC < prev    next >
Text File  |  1996-08-28  |  12KB  |  282 lines

  1. NY2008 (update 5)
  2.  
  3. !!!
  4. NOTE: When I added new weapons i have added them after the old ones to keep
  5. compatibility with the older versions
  6. !!!
  7. NOTE2: This file contains the structures of version 0.10 no InterBBS structs
  8. though
  9. !!!
  10. NOTE3:I found out about a misspelling which is CRAPS is supposed to be CRABS,
  11. it's still CRAPS in the datafiles (the text dropfile and the enum types), but
  12. be sure it's crabs when you display it to the user.
  13. !!!
  14.  
  15. These are the 'C' structures used in user files, .sts file and mail, and newz:
  16.  
  17. Also here is a description how they work and stuff like that ... READ ALL!!
  18.  
  19. NOTE: all numbers of records are 0 based ... 0=1st record, user number 0 is
  20. the first in the file, enemy number 0 is the first in the file .... this is
  21. done for easy seeking of records .... to get the pointer to the beginning of
  22. record 34 in the user file do:
  23.  
  24.   fseek(fpUserFile,34 * sizeof(user_rec),SEEK_SET);
  25.  
  26.  
  27.  
  28. These are the enumerated types:
  29. (!!!!!!be sure to store them as *UNSIGNED CHARACTERS* not int!!!!!)
  30. (or you can use character values directly to write to the user file,
  31.  here's how that would work: first choice=0, second=1 ... e.g. POT=0, HASH=1)
  32.  
  33. typedef enum {HANDS,PEPPER,KNIFE,CHAIN,GUN,RIFLE,LASER_GUN,SHOTGUN,
  34.               MACHINEGUN,GRANADE_LAUNCHER,BLASTER,A_BOMB
  35.               SHARPSTICK,SCREWDRIVER,HAMMER,LEAD_PIPE,COLT,
  36.               ELEPHANT_GUN,NAILGUN,ASSAULT_RIFLE,PROTON_GUN,
  37.               NEUTRON_PHASER,ULTRASOUND_GUN} weapon;
  38. typedef enum {POT,HASH,LSD,COKE,PCP,HEROIN} drug_type;
  39. typedef enum {MALE,FEMALE} sex_type;
  40. typedef enum {HEADBANGER,HIPPIE,BIG_FAT_DUDE,CRACK_ADDICT,PUNK} guy_type;
  41. typedef enum {NONE,CRAPS,HERPES,SYPHILIS,AIDS} desease;
  42. typedef enum {ALIVE,UNCONCIOUS,DEAD} guy_status;
  43. typedef enum {NOWHERE,MOTEL,REG_HOTEL,EXP_HOTEL} hotel_type;
  44.  
  45.  
  46. And here is the structure of the user file (and the .sts file):
  47. (you should not use the user file in the IGM, but this structure is written
  48.  to the temporary file .sts which you should read and modify upon exit)
  49.  
  50. NOTE: With BETA 9 the name of the .sts file changed to
  51. n<zero padded node number>.sts (the old style .sts files exist but changing
  52. them will not make any difference. They are there only for crash recovery
  53. purposes)
  54.  
  55. NOTE: All the strings are null terminated, if you are using pascal, use a
  56. conversion routine! if you are just creating IGM it is probably better
  57. to use the text character information file, the .stt file, read the
  58. 3rdparty.doc for more info.
  59.  
  60. NOTE: Editting hitpoints and strenghts is only temporary so not recomended,
  61. these are reset to defaults each time the user rise a level ... this will
  62. be redone sometime in the future, but not yet ... (i strongly recomend
  63. against doing that, and under no circumstances do not make hitpoints
  64. larger that maxhitpoints, or make max hitpoints smaller!)
  65.  
  66. NOTE: Read the SCORE FILE INFO further on, on modifying this file!!!
  67.  
  68. //Player User File structure (v0.10+ format)
  69. typedef struct {
  70.     //character records
  71.     char            bbsname[36],     //the BBS name of the user
  72.             name[25],        //the name of the character
  73.             say_win[41],     //what the user says when he wins
  74.             say_loose[41];   // "    "    "   "    "   "  looses
  75.     //integer records
  76.     int             rank,            //user rank (read score file info
  77.                      //in this document!!!)
  78.             days_not_on,     //days the user has been inactive
  79.             strength,        //attacking strenght of the user
  80.             defense,         //defensive strenght
  81.             condoms,         //condoms user has
  82.             since_got_laid,  //days since the user last got laid
  83.             drug_hits,       //the hits of drug that the user has
  84.             drug_days_since; //if addicted how long the user
  85.                      //has not used the drug
  86.  
  87.     //long type records
  88.     long            hitpoints,       //users hitpoints
  89.             maxhitpoints;    //maximum of the users hitpoints
  90.  
  91.     //unsigned long type records
  92.     unsigned long   points,          //users points
  93.             money,           //money in hand
  94.             bank;            //money in bank
  95.  
  96.     //unsigned char type records used as values
  97.     unsigned char   level,           //user level
  98.             turns,           //fights the user has left today
  99.             hunger,          // % of hunger
  100.             sex_today,       //sex turns left today
  101.             std_percent,     // % of current std
  102.             drug_addiction,  // % of drug addiction
  103.             drug_high,       // % of how "high" the player is
  104.             hotel_paid_fer,  //for how many more days the hotel
  105.                      //is paid for
  106.             days_in_hospital;//how many days has the use been
  107.                      //in hospital
  108.  
  109.     /*enumerated types stored as unsigned chars!!! (not int)*/
  110.     guy_status      alive;           //user: alive, unconsious, or dead
  111.     sex_type        sex;             //user sex: Male, Female
  112.     guy_type        nation;          //what is he:
  113.                      //punk, headbanger ...
  114.     weapon          arm;             //players weapon
  115.     desease         std;             //current player std
  116.     drug_type       drug;            //current player drug type
  117.     hotel_type      rest_where;      //where the user is staying lately
  118.  
  119.     /*added values BETA 9*/
  120.     char            wtc;             //# of wtc bombings allowed per day
  121.                      //default=1
  122.     char            poison;          //number of poisoning of water allowed
  123.                      //per day, default=1
  124.  
  125.     /*added values v0.10*/
  126.     unsigned char   rocks,           //Rocks, usable in fights
  127.             throwing_ability,//Throwing ability 0-100
  128.             punch_ability,   //Punching ability 0-100
  129.             kick_ability;    //Kicking ability 0-100
  130.         char            InterBBSMoves;   //InterBBS Moves left today
  131.  
  132. /*reserved for future use 3 bytes reset to 0*/
  133.     char            res1;
  134.     int        res2;
  135.       } user_rec;
  136.  
  137. Here is the mail header file NY2008.MSX structure:
  138.  
  139. typedef struct {
  140.     char    sender[25];    //sender character name
  141.     char    senderI[36];   //sender bbsname
  142.     sex_type sender_sex;   //sender sex
  143.     char    n1;            //unused!
  144.     char    recver[25];    //receiver character name
  145.     char    recverI[36];   //receiver bbs name, used for searching mail
  146.     long    location;      //position of the message text in the
  147.                    //NY2008.MSG file
  148.     int     afterquote;    //how many lines are a quote
  149.     int     length;        //how long is the post
  150.     int     flirt;         //flirt flag used for other flags too:
  151.                    //0=no flag normal mail
  152.                    //1=sender wants sex
  153.                    //999=positive reply to flirt 1 (no mail body)
  154.                    //1000=receiver was raped (no mail body)
  155.                    //1001=receiver was defeated (no mail body)
  156.                    //1002=receiver got some money (the amount
  157.                    //stored as text in a one line msg body)
  158.     desease ill;           //sender's illness (std)
  159.     char    n2;            //unused!
  160.     int     inf;           //sender's infection percent (std_percent)
  161.     int     deleted;       //is this mail deleted (TRUE,FALSE)
  162.     } mail_idx_type;
  163.  
  164. Here is how the NY2008.MSG works:
  165.  
  166. location record points to the line where message starts in NY2008.MSG
  167.  
  168. A line (any length is stored as an 80 byte character field) so the position
  169. of a message body is location*80. And just read an 80 character string, (79
  170. characters and a NULL terminating character) each record is 80 char long and
  171. the terminating NULL character is anywhere in this field. If the NULL character
  172. is the first character, it's a blank line!
  173.  
  174. All the other records are in lines as the units, (not bytes) too so if length
  175. is 3 the message is 3 lines long.
  176.  
  177. And online messages. To send an online message, add to or if it does not
  178. exist create a file called "U00<user number>.OMG", and store two, null
  179. terminated strings in it, one of them is 51 characters long (including the
  180. NULL character) and that is the message, the one that follows is the name
  181. of the sender which is 25 characters long. Do not delete this file, and if
  182. it exists add to it, so no messages are lost, in C use the "a+b" mode.
  183. The game will erase it when the user recieves the messages. Do not
  184. send online messages in the SingleNode mode, they would not work.
  185.  
  186. NOTE the .OMG file has to be in the flag directory to be read.
  187.  
  188.  
  189. Here is the newz structure:
  190. files are : NYNEWS.YES for yesterday's news
  191.         NYNEWS.TOD for today's news
  192.  
  193. struct {
  194.   char  tagline[80],
  195.     name[25],
  196.     name2[36];
  197.   int   flag;
  198. } newzfile;
  199. // flag settings//
  200. // 0 - system news (tagline)
  201. // 1 - user announcment (name) anounces (tagline)
  202. // 2 - user BUSTED (name) for (tagline)
  203. // 3 - user newz (name) (tagline)
  204. // 4 - user kicked ass (name) kicked (name2)'s ass
  205. // 5 - user had his ass kicked (name) was beat by (name2)
  206.  
  207.  
  208. And here are the enemy file structures .... (street fights)
  209.  
  210. typedef struct {
  211.     char            name[36];   //name of the enemy
  212.     long            hitpoints,  //it's hitpoints
  213.             strength,   //enemy offensive strength
  214.             defense;    //users defensive strength
  215.     weapon          arm;        //users weapon
  216.     char            n1;         //not used
  217.     } enemy;
  218.  
  219. This is an enemy record in the enemy file "NYENM.DAT", here is how the
  220. level indexing works ("NYENM.IDX"):
  221.  
  222. the file "NYENM.IDX" consists of two arrays:
  223.  
  224. int first[21];
  225. int last[21];
  226.  
  227. (In this order!)
  228.  
  229. The first array contains the number of the first monster (the number of the
  230. record in the enemy file 0=1st) to choose randomly from. last is the last
  231. enemy that can be used for that particular level.
  232.  
  233. Example:
  234.  
  235. user is in level 5 and first[5]=50 and last[5]=60, which means:
  236. create a random number between 50 and 60 and that is the enemy the user
  237. will fight.
  238.  
  239.  
  240. SCORE FILE INFO!!!!! READ BEFORE DOING ANYTHING!!!!!
  241.  
  242. This is the score file .... it is created every night during the
  243. maintanance. ("NY2008.SCR") (It is used for lot of stuff so don't mess
  244. it up !!!)
  245.  
  246. DO NOT TOUCH this file in your IGMs, I included the structure so that
  247. if you are going to change points of players or add players or NPCs
  248. outside of NY2008 (not in an IGM), so you can add them to the scr file
  249. and SORT it.
  250.  
  251. Also if you sort the score file, you have to change the rank variables
  252. in the user file. And vice versa, if you change the order of the user
  253. file, you have to change the user_num variables in the scr structure ...
  254.  
  255. Remember there is no temporary file for this structure and it is writen
  256. to all the time so the scores are up to date ... it is also used for user
  257. searching. Changing users properties here will have little effect.
  258. I strongly recomend not messing with the usr and scr files if any users are
  259. online. If you do, to change a rank of a user that is online send him a
  260. rank flag file (binary) ("U00?????.RNK"). dump the integer value of his new
  261. rank to this file. the proccess looks for these files and will process them
  262. as soon as it can ... (user num and alive numbers might change during the
  263. maintanance ... packing) .. this file should be treated as read only and if
  264. you read from it while people are online then close it as soon as you can,
  265. so other nodes can read it ... (or write - the game does)
  266.  
  267. typedef struct {
  268.     char            name[25]; //character's name
  269.     guy_type        nation;   //what is the character
  270.     char            n1;       //not used
  271.     int             level;    //his level
  272.     unsigned long   points;   //points
  273.     guy_status      alive;    //alive, unconsious or dead
  274.     char            n2;       //not used
  275.     sex_type        sex;      //users sex
  276.     char            n3;       //not used
  277.     int             user_num, // user's number in the usr file
  278.             online;   //TRUE or FALSE ... is the user online.
  279.     } scr_rec;
  280.  
  281.  
  282.